refactor massive method