migrate from local_or_ to getattr