Refactor to get existing code working with cloning all branches