Making sure functions will be instantiated only if needed