better button handling, ui template
added ui template