refactor blocks