MetadataFactory class: enhance code style for getMetadataForClass method

Initiate variables outside loop & new lines