move controller befor listener from routes to controller