cleaned up if statements