More work to reduce duplicate code.