Merge pdo-refactor branch into master