start rework of gui code