making gladd.js more generic