move non-gui stuff out of gui/