some refactoring

unify coding styles across all demos