refactoring by adding some partials