fix extra ok methods, extract if block to a method