One function to rule them all.