Simplified the template
Fixed small bugs