Hw2 3 Refactoring works good