Adding 'edit' ability to CLIExample2 along with some refactoring