handle command refactored. kvs refactored.