Clean up variable and scope