Refactored the codes for main.py,ui.py,videomaker.py