improve inserter, move random data generation to a model to simplify the inserter code