Clean and optimize code.