Why move the function to controller.go?