Refactored branches to ArrayList