refactored button enable/disable