Refactored if