restructure and brush up state editor gui