Stuck on refactoring repo.js