factor editor commands into behaviours