Fix typos.
Refactor code layout.