Move the code to private methods in the only place that needs it. Change-Id: I7aa038e055adc1aea9faafd17b86e304ee2ca758