Updated per feedback to utilize Nginx function wrappers.