Removes unused files and replaces template info