refactor code to allow for configuration

rename to ```trigger```?