externalized the show function