If refactored