Moved external helper function to private