First functions for observer.php and mod.php