modified fill-up and show template functions