Refactored simulation directive to (hopefully) make it cleaner