OOifying code