Refactored the closure locations code to look less bad.