big refactoring. history is missing