more code cleanup and docs