fix spelling + refactoring