Move to class structure and call depending on environment variable.