constraints inside classes