code clean up part 2