Some refactor and cleaning in the gui project