Big cleanup, implementation of the AVR