Some work on instantiation + refactorig

- first implementation istantiate method
- removed some useless static cast
- other things...