Change hardcoded functions to use reflection instead.