implement util funcs and decorator template