rearrange so log message not printed many times
use null function so model is picklable
fix wrapping