Refactored simulator