simplified without rewriter