Replaced/cleaned some code with partials