Moving code from __init__

Putting a function in the __init__ is considered a bad practice
in Python world. Moving it to CMD utils where it should belong.

Change-Id: I16279053202659c796bd6de2f4afdbf51b245a5a