#20 more refactoring