improve update batch

Build only when it is needed.
Merge pull request #135 from k-takata/topic/improve-update-batch

improve update batch