fix dependencies + handle jade + refactor loops