refactoring invoking of actual function to share callback handler