refactored if else challenge