button controls refactored