Add tests
Simplify attr() method as a getter