Class and main example with some redundancy