Refactor getLangCompStats function

This will make it load faster than the previous one.