Better logic for enabling/disabling buttons based on element