Change profile2 to use metadata wrappers in all file and basic clean up