test(examples) refactoring incl adding tests