minor refactors/fixes