refactoring: PapillonCore.hs