code cleanup, doc