optimize and re-add path feature