refined the compose and debounce methods