Refactored into providers, allowing expansion in the future plus it handles directories correctly.