simple log operations; rewrate db handling