map pseudo astar and code cleaning