More refactoring and testing requires for pinry