Refactor events to allow for other search types