I'm getting the feeling that there is a better way to do this