Moved sidebar and pagination to partials
Implemented dependency injection and updated code to be easier to understand