Remove indentation issues and optimise.