This commit make this function more universal