Started refactoring.
Removed rescan functionality and some other stuff.