clean up code by changing unless/else to if/else