Refactoring of business logic