Refactored scanner code into scanner sub folder