move hooks to base.php