refactoring to use PHP constants with convention of APP_ prefix
moved the helper functions to new file app_util.php