Refactor example code in README for consistency to other examples