refactor(create): split spagetti into functions