Stem Spotter implementation

refactoring based on Pablo's advice