scope refactor + test for methods