remaining changes before rewrite