models

models are refactored, bug fixed