refactory for to support block