refactore getContraints