Added table entities and names to db and removed useless functions