rewrite some method to aviod empty statements