big cleanup with multiple states on same page