Fix objects generation performance issues