Refactor html groupings