this looks very much as duplicate code, can you try to improved it?