Improving code quality of AStar