cleaning up if statement