Refactor cjs