general cleanup and some more comments