Clean up code and regularize indentation.