templating parse fucntion