further refactoring work