Refactored examples to place the methods in the case classes