Improve internal details of the user directory code.