refactors heinzel.js