Clean up comments and state ordering.