ticket:6 refactoring