Refactoring toggling of active class for filter buttons