Extracting logic