refactoring languages method