Refactored to method.