name lookup optimisations: improved indexes; quicker handling of failure cases