refactored structure to more widget like classes