first attempt at model rewrite