refactored debouncer