[TASK] Do some refactoring and fix some spelling errors