refactor short wall check