EDST-69: please merge this into EDST-51

EDST-69: please merge this into EDST-51
I dont like this code