Adding more formal structure to controller