Starting a code rewrite, initial changes