basic button handling infrastructure