small refactoring of astar decoding
astar minor refactoring