Fix typos, refactoring.