fixed editor issues, encapsulated editor initialization