Refactor, and add some stuff about history