refactoring scanning ui