Playing around with extracting logic