Small refactorings.

Change-Id: Ic462aafc833d334d11146dfc6881a2be3415f46b