massive refactoring
refactoring done