rebuilding entities mapping