David and obedience to God