Improved encapsulation.
Added possibility to override getAttr().