refactor handler to use url configuration