Faster method for checking if fn exists