Improved method for generating object.