cleanup gui code