refactoring - stage 3
refactoring - pileup works
refactoring contd