stop using setattr and use real attributes