New tests on scope, and refactor to reuse code for those tests