refactoring (reverted from commit a00a1b411ad0fa03eac24518182aa9cbf4541d63)
refactoring
Refactoring + file mess /
fix a mess. make normal structure of js code