[cleanup] minor refactorings, cleanup