add models factory to handle data

Signed-off-by: fraserxu <xvfeng123@gmail.com>