refactored Commands part on slave