refactor jade files and related templatizer code