clean up the code
use a atom to store the wrapped function to original function mapping