some small refactoring.