better api for listener