general cleanup and explanation