Refactoring some inline actions to methods for tests.