allowing callers to drop null/empty params if desired; refactoring