support multiple buttons and code simplification (user code)