Simplified commands handling a bit.
Signed-off-by: Dmitriy Pavlenko <dmitriy.pavlenko@sysgears.com>