basic code restructuration