A method of handling an optical signal in a receiving device in an optical network, comprising steps of: - receiving a first optical signal from a transmitter comprising a first direct modulated laser, the first optical signal comprising a first data in form of optical "1"s and optical "0"s transmitted at different optical frequencies, - filtering the first optical signal with an optical filtering unit, to pass a frequency of the optical "1"s and attenuate a frequency of the optical "0"s, obtaining a second optical signal, - detecting the first data from the second optical signal; wherein, the optical filtering unit comprises a second direct modulated laser, the second direct modulated laser comprising: a laser cavity, an electrical input configured to receive a bias current, and an optical interface configured to receive an input optical signal, and output an output optical signal, wherein, both the input optical signal and the output optical signal on the optical interface of the second direct modulated laser has access to its laser cavity; the method further comprising steps of: - determining the bias current for the second direct modulated laser, so that the frequency of the optical "0"s comprised in the first optical signal is attenuated more than the frequency of the optical "1"s comprised in the first optical signal, when the first optical signal is applied to the optical interface of the second direct modulated laser; wherein the bias current is so determined that the frequency of the optical "1"s comprised in the first optical signal matches with a peak of one side-mode in a spectrum of the second direct modulated laser; - driving the second direct modulated laser with the determined bias current. - receiving a first optical signal from a transmitter comprising a first direct modulated laser, the first optical signal comprising a first data in form of optical "1"s and optical "0"s transmitted at different optical frequencies, - filtering the first optical signal with an optical filtering unit, to pass a frequency of the optical "1"s and attenuate a frequency of the optical "0"s, obtaining a second optical signal, - detecting the first data from the second optical signal; wherein, the optical filtering unit comprises a second direct modulated laser, the second direct modulated laser comprising: a laser cavity, an electrical input configured to receive a bias current, and an optical interface configured to receive an input optical signal, and output an output optical signal, wherein, both the input optical signal and the output optical signal on the optical interface of the second direct modulated laser has access to its laser cavity; the method further comprising steps of: - determining the bias current for the second direct modulated laser, so that the frequency of the optical "0"s comprised in the first optical signal is attenuated more than the frequency of the optical "1"s comprised in the first optical signal, when the first optical signal is applied to the optical interface of the second direct modulated laser; wherein the bias current is so determined that the frequency of the optical "1"s comprised in the first optical signal matches with a peak of one side-mode in a spectrum of the second direct modulated laser; - driving the second direct modulated laser with the determined bias current. - determining the bias current for the second direct modulated laser, so that the frequency of the optical "0"s comprised in the first optical signal is attenuated more than the frequency of the optical "1"s comprised in the first optical signal, when the first optical signal is applied to the optical interface of the second direct modulated laser; wherein the bias current is so determined that the frequency of the optical "1"s comprised in the first optical signal matches with a peak of one side-mode in a spectrum of the second direct modulated laser; - driving the second direct modulated laser with the determined bias current.