general cleanup refactors