Extracted Branch functionality into its own module