Refactor Database.java: Merge it with Manager.java.