adding dynamic pagination and some stats page refractoring