Behavior move to controller

First step to move the behavior from view to controller.