refactor scope tests