separated insert and create functions