CSS simplified and pagination duplicate code removed