moved method from helper to controller