refactor from url to objects