refactored to an escapsulted object
now widget is self contained