added files for rearchitecting (again)
refactorings and cleaning
fixed THE BUG