Fix instantiation order