Branch refactor