Sorting out the controller to handle file changes