add pagination for front page;clean the code of admin panel