build: cleanup build system, compartmentalize.