generalize gui handler for future ease of use