Replace code with study version
Refactoring for unit of work scope