Remove data group attr on ungroup
Improve efficiency in some statements