cleanup code and comments