Refactor various examples