removed unused commands, some refactoring