Rewrite code for reporting undefined calls for a bit better performance