Moved some functionality out of DB.scala into DBManager.scala