Add a few comments and rename a few methods.
Reversed a bit of refactoring because it doesn't really make sense with untyped warnings.