miniSim refactored.