[example] Improve/refactor OpenStack example code