Factorise attribute binding function