some build system restructuring to ease maintainance