more scalable way of inserting data