this should be a registrable function pointer rather than a function.