group primitives by type; begin animation refactor