I'm a little bit confused by this call chain... I'm not as familiar with some of the logic here; can you explain how this is more database agnostic, and maybe add some comments about what these calls do?