code cleanup removing clutter and updating comments