[client] improve code for customization