#142 refactoring