refactoring: some simplifications