Moved median specific parts to median