More cleanup and improvements