Refactor code and correct spelling errors.