common dir code