some cleaning
moved here some utilies from spectrox, useful for users at bl