some small refactors