general cleanup before refactoring