You should use Filesystem instead of duplicate logic.