Remove old hardcoded trigger code, to be implemented
Cleanup and restructuring due to recent changes
Change meaning of ~ to regex replace