replace ContentResolver with function arg / error handling