ead8d58 More abstract and simplify in database layer.