code cleanup part 1