Refactor to allow for configuration via the query string