reduce function calling code for rendering path finder