refactor pileup