Total refactor, in order to create a reusable widget