Improve code a bit
Reindent
History is now a direct LinkedList to avoid systematic cast