unit of work refactoring