add predict. refactoring.