Move prepare function from parse into prepare