Moved derived attributes to model
Added icon
Cleaned some tricky code.