public IFunction lookupFunction(final String key) {
        if ( null == localFunctions.get() ) {
            localFunctions.set(new HashMap<String, IFunction>());
        } else {
            if ( localFunctions.get().containsKey(key) ) {
                return localFunctions.get().get(key);
            }
        }
        synchronized (functions) {
            return functions.get(key);
        }
    }