removing unnecessary branching