refactoring for sprint 2