Jade revisions

I've made the code much more reusable.