converted to php templates