Cleanup unused code
Update template