Refactors attributes extraction.