Minor code cleanup and documentation update.

Chore: Fixed some typos in the in code documentation
Chore: Reorganized some methods to improve readibility