Made upgrade and create functions universal