You can move correctness checking to WebResponse.isValid() method. You will avoid code repetition in LoginFragment. Then you can return webResponse.isValid().