old changes to make controller structure more sensible