Tidy up, make setup logic more sane.