convert to anonymous functions