refactor getcurrentlanguage method