misc: small refactoring