general cleanup-type refactoring