Implement history functionality and improve interface