full rewrite. Put foundation framewokr in its own folder