Remove unneccessary variables and snprintf calls