some fixes after the last refactoring