Significantly refactored handlers in editor to be less insane