RF: refactor building to allow separate builds