Refactored

More separation of View and Controller.