refactored simulator in extra file