more efficient way to find init dir