using better way to insert data and create table