Updated code for consistency

Re-arranged the order of the `locals` and `view` definitions to match the other views.