Clean up modules templates and code