code cleanup, adding controllers to gui