Fix formatting and replace getBranches with lodash functions