refactored passing private attribute as argument in method