refactor effects