cleanup vars and format