Refactor example1 compute/call into a class