Cleaned up controller

Cleaned up GUI controller code.