extracted history button handling from main class