Code cleanup part 2