refactoring of user service and tdd tests