Code cleanup: split building selection out to a new ED file