Remove duplicate code.

@inf0rmer I think this removes some duplicated logic and the specs still pass. Can you see any reason not to merge this change?