x11rdp: cleanup and refactoring