[FIX] code cleanup + unit test added