Tidying up the codes.
merge constraint