fixed english typos, fixed names mismatches and minimal refactoring