More refactoring to simplify individual examples