More on optimization and cleanup todo