We should avoid this duplication of code - move it to some private method.