packaged up refactor code examples