Cleanup and improvements