cleanup, remove some unnecessary branching