Refactored factories out of path instances.