refactoring db structure for pulls