Complete refactoring and add style settings