Refactored and added setter method.