small refactoring
add sample functions and made smal refactoring