refactor before as a chains