refactor block