fixed class instantiation priority to make sure some modules run before others