refactor, fix return of local/global, alias