update abstract class code to reduce the rely