Refactoring creation of instances

## v0.2.0101
## for ticket [164]
To greatly improve performance