add declare & sleep to templates