big refactoring and cleaning