timedb: refactor using path module