updated to comply with new commonjs module style