started big refactoring
end of refactoring