Cleaning up if/else