Refactored toggling buttons into a directive