refactory framework and samples.