refactoring modules and fixing GUI responsive issues