Code cleanups suggested by Joe