refactoring of the command...less complexity