First implementation of history handling