Extracted methods from mojo test for easier reading.