reorganize code in create cli