Reworking to work with commonjs - broken