refactoring frontend code a bit to be more modular and use a config structure for widgets