refactored if statement monster