making create command code more flexible