preparing for code rewrite