Prepare better stack handling