add support for instantiation callbacks, god tweaks and bug fixes