cleanup code, fix search in editor