Auto-update and some optimizations