- added test for scan
- some refactoring around the tests