Refactor Database.java by creating this class.