Warning removal.
More cleanup and code organization.