i'll try to use some kind of path resolve helper which callbacks for each part and allows handling this could be a better idea also will be able to refactor where code to use it as well :)