Factor out duplicated editor loading.