[issue:2] Put multiple database insertions to transaction to make them faster