More clean-up and rewrite of startup