[modules] Remove unused imports and variables.

Also fixes some formatting.
[url] Fix undefined variable.