Cleanup. Adds db interface