some small refactor