michael: some small refactoring