code refactors, cleanup