refactored smooth path