Try to do this by removing duplication between the files and moving common part into a shared template