further porting work for gui