Make template work with struct