complete some further refactoring