Moved lambda conversion logic into a separate class.