rebuild directory prototype