logic moves to controller