added HBox layout and a little of refacto