Clean up the /sql a bit, renamed some vars