Smarter way to fill the allAttributes array