module rewrite for more flexibility