Finished refactorings, updated examples