Fixes typos and introduces wording changes. Adds minor code refactorings.