some minor refactors