refactor(branch) refactored initializing and branch interface