need to abstract this better, but commonjs for global requires