more code cleanup and note taking