refactor legend parsing in level loader