a better way to parsing url