Code cleanup.
First part of the translation.