Tui Main Project Code Refactoring