Some refactoring
Typo correction