Moved scanning code to the framework 

fixes #89