Refactor guest code.