Refactored to the new database way.