Refactor resource partials and make sure templates play nicely with dependency trackers