Update examples, slight refactor and more tests