refactor spcfile and related classes