Refactored to use partials