Fixed some typos and refactored some calls