separate data and tempalate