Optimization and code cleaning.