Added functionalities in CreateModelCommand() and improved code readability