refactor with long id
insert elements