Code cleanups and validation class added