Change setLevel methods class methods and add tests of them