Extract some methors to models.
Rm uesless codes.