improve getInheritedAttrs by reducing merge call #17