Move debounce logic to a new file.