refactored commands
fixed tests and issues