what do you think, would it be possible to remove this code duplication (at least to me it looks like duplication)?