Removed some redundant code. Factored out translations.