ticket:8 refactoring