Some code improvements
Manual update