Moved editor creation code into separate file