minor style tweak
minor refactorings and style clean up