code cleanup/documentation