Better implementation of actions history (thanks @mdarse)