Implement global scope resolving