Simulation refactoring

Some refactoring and the documentation of the devices and the simulation.