Update functions

Optimalizations

(Untested)