command refactorings+tests