extracting temporary stack as separate class from ModuleStack