refactor buttons into ui widgets