refactoring and support user and system tables scopes have been added