fixed --language command line parameter; refactoring