fixed warnings and removed useless template programming