minor changes

some small refactors and code format cleanup