Smartfolder: refactoring to singleton + cleanup