Factor attributes to class level
Add documentation