Update functions

Optimalizations