Tweaks to Remove bad css classes from buckets

@gergely-ujvari just updated this to implement your fix but using `.toggleClass`. I also cleaned up the whole method, will need to add some tests though so bear with me.