refactor and add partials