reworks rule engine to separate, locally runnable file