refactoring per exercises