define macro for handler functions


For reducing duplicated codes for handler functions.