Suggest to move the following to a separate function.