refactoring and some command shortcuts