refator and add demos
refactor