huge refactoring, some new build scripts