Abstract branch creation into one concise function