refactor programming languages exercise