Improve commenting and pull out comparison into separate method