remove branching from if statement