some refactor main gui