Clean up logging and change command format to accept a single template as parameter.