Fixing indentation and code complexity.