Removed duplicated code and replaced by generic abstract class. Also added some experimental constraints for nonnull values, and added summary extractor