Added Swing adapter and little refactor