one more function added for encoding and unit test added for command helper