better way of inserting locations into database