cleaned up ConfigScope and switched to regex for finding the function def