Moved everything into a module