only use reference path when needed