More cleaning an optimizations.