removing unnecessary code and updateing template