refactor invoking of function with Function's functions