Refactor example to reduce lines.