ref and renaming

removed references (bad GUI programming), capsuled stream and xml
handling