Factored out some code and removed empty method.