some big refactoring