Replaces anonynoums functions with named ones

/cc @machty