Extracted formating of config command to function, wrote unit test for it.