Refactor to use additional method for PHP 5.2 issues and to take advantage of recursion for finding subdirectories