Merge XQuartz and X11 modules
Make condition clearer using names
Extract repeated conditional to a method