refactoring ready to test