Refactored method.