further cleanup, still a horrible mess