refactored code for parsing Values resource and fixes