put the rewriter obj creation in to module

def