Refactored simulation