More refactoring of the base station code.