Added a controller layer to abstract functionality away from the user interface.