Some cleanup and commenting