Using `template` will make our codes more elegant.