Improved the DB part