directory refactory