Updated example with init instead of factory