User logic refactoring