some refactoring and finished up SRT support