refactor using partials