pre-branching for refactoring