Refactor URL helper class to make it testable