Prepare the code for ESM support