Refactored for an improved readability

Given the importance of the code in TMetaUtils, investing some time
in making it more readable was well invested.