Code refactoring using partials and includes to reduce the number of repetitions