Refactored using partials