Refactor to vistor pattern and collecting parameter