nit: passing the root url as an option might ease testing a bit here