remove unnecessary css classes, nest the remainder