documentation some code cleanup