Refacor CompareSimpleAttributes and CompareComplexAttributes methods