generalized home dir code