mostly cleanup and comments