Refactor to use partials