Add cleanup on initiation and simpler cleaning up access of editor