Please factor out into a separate function; this function is too big.