Similar to the refactoring that was found in commit 96baa73e Change-Id: I9191299c0055fcdc46e5de85a5de387862b070da