rewrite for opt module