code clean up, part 1