Improve database structure. Simplify the db operations.