Clear stack buffer, and use closures to prevent context issues