Code restructuration phase 2