lots of refactoring, adding incremental build functionality