Implements UI and controller