using mutex and new generic design for commands sent