Added shared-functions.php file and renamed some functions