Code refactoring, Added demo to examples folder