Semplifing the code logic by replacing "while" with "if-else" block
(note for Erik: i`m still using exact method on figisDao)