refactor example