refactor where methods into their own scope for students