let's extract check logic to separate method.