Refactored. Organized Sync and Pathname functionality.