Cleaned up mkgitdir method