protected function readLocation($location)
    {
        $reader = null;

        if (is_dir($location)) {
            $base_location = Validator::fixPath(Validator::fixRelativePath($location));
            foreach ($this->default_filenames as $filename) {
                $file = $base_location . $filename;
                if (is_readable($file)) {
                    try {
                        $reader = $this->getReaderByExtension($file);
                        break; // found possible config file \o/
                    } catch (\InvalidArgumentException $e) {
                        // next attempt as extension has no handler
                    }
                }
                // next attempt, as file is not readable or does not exist
            }

            if (!$reader instanceof IConfigReader) {
                throw new \InvalidArgumentException(
                    'Could not find an environaut config file in "' . $base_location . '".' . PHP_EOL .
                    'Attempted files were: ' . implode(', ', $this->default_filenames) . '.' . PHP_EOL .
                    'Try calling from a different folder or specify a file using the "--config" option.'
                );
            }
        } elseif (is_file($location)) {
            $reader = $this->getReaderByExtension($location);
        } else {
            throw new \InvalidArgumentException(
                'Currently only regular files and directories are supported for config file reading.'
            );
        }

        $config_data = $reader->getConfigData($location);

        return $config_data;
    }