Refactory templates