Code clean up part 2