cleaned up url parsing