smart do-it-all function