added methods to build in-memory Instances dataset