Refactor attribute handling
Refactor data dict building
Refactor data dict building