Renamed escape to prepare.
Minor optimizations.