refactoring for handling block state