added sample factory and how-to-use