use function pointer instead of interface