smarter variables assignation