refactored spectrum base class into standalone module