Early commit... this version is completely broken
Improved modularization