Arrange some code and add css to group by func