commonjs rewrite WIP