move attaching events to a separate class

in order to keep the controller simple