Refactor axis initialization logic

Move the code to a separate function to make it easier to follow.

Bug: 198472780
Test: none
Change-Id: Ic881814ec8cee8bb5535ed80bb6ae92f60d6b1a0
2 files changed