refactoring scanner / adding test and coverage reporting