some refactoring
update samples