refactored using partials