refactor and added xattr iteration feature