This looks like copypasta - make one method that does this for both.