Refacotring the DB-Layer