Tidy up controller. Extract some generic patch methods.