Moves some utility functions out of Munkres class.