cleaned up if statements

not sure if this is cleaner or even more messy.