work on refactor using trigger