Refactor of demo executable code