refactor Lang class