extracting function from ctrl