Still the implementation for model generation. Not complete yet.