refactored query string to handler mapping to be more clear