More work implementing database layout.