Update median.
Respect openurl. Some refactoring and cleanup.