non GUI related stuff. need to merge ...