Factor out logic to determine if something is called by a particular name into a function.