Remove unused stuff, fix template