Improve calculated attributes handling