Refactor blockwise small scan functions