change models with relation fields and revise all related method. add sample scripts.