Clean up variables and improve comments