Cleaned up attribute extraction.