clean code and pulled all triggers out into config file