Extract code for checking assignments in class body